/**
 * 时间：2024-08-25
 * 作者：waygc
 * 描述：关于页，这个项目的详细说明在这里加载，也作为网站首页
 * 
 * 改版履历
 * [20241017] 修改 markdown 为 hiton
 */
import React from "react";
import HitOn from "hiton";
import "hiton/demo/hiton.css" // 因为需要样式，所以这里需要加载
import { contentBorderStyle } from "./../lib/custom-styles";

const hitOn = HitOn.create({
	image: {
        align: "center",
		calling: false
	},
	table: {
		calling: false
	},
	heading: {
		countingMode: false
	}
});

class Home extends React.Component {
	constructor (props) {
		super(props);
		this.state = {
			file: ""
		};
		this.getHtmlVal();
	}

	async getHtmlVal () {
		let file = await window.$http.readFile(`/react-demo/res/about.md`);
		// const marked = plus.create();
		file = hitOn.parse(file);
		this.setState({ file });
	}

	render () {
	return (
			<div class="modell-markedjs-plus-box" style={contentBorderStyle} dangerouslySetInnerHTML={{ __html: this.state.file }}></div>
		);
	}
};

export default Home;
